package edu.dayu.util;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class ConstantPropertiesUtils implements InitializingBean {
    @Value("${alipay.appId}")
    private String appId;

    @Value("${alipay.merchantPrivateKey}")
    private String merchantPrivateKey;

    @Value("${alipay.alipayPublicKey}")
    private String alipayPublicKey;

    @Value("${alipay.notifyUrl}")
    private String notifyUrl;

    @Value("${alipay.returnUrl}")
    private String returnUrl;

    @Value("${alipay.signType}")
    private String signType;

    @Value("${alipay.charset}")
    private String charset;

    @Value("${alipay.gatewayUrl}")
    private String gatewayUrl;


    public static String APPID;

    public static String MERCHANTPRIVATEKEY;

    public static String ALIPAYPUBLICKEY;

    public static String NOTIFYURL;

    public static String RETURNURL;

    public static String SIGNTYPE;

    public static String CHARSET;

    public static String GATEWAYURL;

    @Override
    public void afterPropertiesSet() throws Exception {
        APPID=appId;
        MERCHANTPRIVATEKEY=merchantPrivateKey;
        ALIPAYPUBLICKEY=alipayPublicKey;
        NOTIFYURL=notifyUrl;
        RETURNURL=returnUrl;
        SIGNTYPE=signType;
        CHARSET=charset;
        GATEWAYURL=gatewayUrl;
    }
}
